package game.leon.seawar.vo;
import game.leon.seawar.vo.ByteBuffer;
import game.leon.seawar.vo.BaseVO;
import java.io.IOException;
public class Vo {
private Vo() {}

public static class EmptyVO extends BaseVO {
@Override public int vid() { return 1; }
@Override public void pack(ByteBuffer b) throws IOException {
super.pack(b);
}
@Override public void unpack(ByteBuffer b) throws IOException {
super.unpack(b);
}}
public static class ResultVO extends BaseVO {
public short code;
@Override public int vid() { return 2; }
@Override public void pack(ByteBuffer b) throws IOException {
super.pack(b);
// code
b.write_short(this.code);
}
@Override public void unpack(ByteBuffer b) throws IOException {
super.unpack(b);
// code
this.code = b.read_short();
}}
public static class CreateBattleParamVO extends BaseVO {
public int counter;
public int striker;
@Override public int vid() { return 3; }
@Override public void pack(ByteBuffer b) throws IOException {
super.pack(b);
// counter
b.write_int(this.counter);
// striker
b.write_int(this.striker);
}
@Override public void unpack(ByteBuffer b) throws IOException {
super.unpack(b);
// counter
this.counter = b.read_int();
// striker
this.striker = b.read_int();
}}
public static class LoginVO extends BaseVO {
public String name;
public String pwd;
public short ver;
public int time;
public double d;
@Override public int vid() { return 4; }
@Override public void pack(ByteBuffer b) throws IOException {
super.pack(b);
// name
b.write_string(this.name);
// pwd
b.write_string(this.pwd);
// ver
b.write_short(this.ver);
// time
b.write_int(this.time);
// d
b.write_double(this.d);
}
@Override public void unpack(ByteBuffer b) throws IOException {
super.unpack(b);
// name
this.name = b.read_string();
// pwd
this.pwd = b.read_string();
// ver
this.ver = b.read_short();
// time
this.time = b.read_int();
// d
this.d = b.read_double();
}}
public static class InstructVO extends BaseVO {
public short op;
public short[] params;
@Override public int vid() { return 5; }
@Override public void pack(ByteBuffer b) throws IOException {
super.pack(b);
// op
b.write_short(this.op);
// params
b.write_short(params.length);
for (short node_params : this.params){
b.write_short(node_params);
}
}
@Override public void unpack(ByteBuffer b) throws IOException {
super.unpack(b);
// op
this.op = b.read_short();
// params
int n_params = b.read_short();
this.params = new short[n_params];
for(int i_params=0;i_params<n_params;i_params++){
this.params[i_params] = b.read_short();
}
}}
public static class ChunkVO extends BaseVO {
public InstructVO[] chunk;
@Override public int vid() { return 6; }
@Override public void pack(ByteBuffer b) throws IOException {
super.pack(b);
// chunk
b.write_short(chunk.length);
for (InstructVO node_chunk : this.chunk){
node_chunk.pack(b);
}
}
@Override public void unpack(ByteBuffer b) throws IOException {
super.unpack(b);
// chunk
int n_chunk = b.read_short();
this.chunk = new InstructVO[n_chunk];
for(int i_chunk=0;i_chunk<n_chunk;i_chunk++){
InstructVO p_chunk =new InstructVO();
p_chunk.unpack(b);
this.chunk[i_chunk]=p_chunk;
}
}}
public static class SkillVO extends BaseVO {
public short id;
public short type;
@Override public int vid() { return 7; }
@Override public void pack(ByteBuffer b) throws IOException {
super.pack(b);
// id
b.write_short(this.id);
// type
b.write_short(this.type);
}
@Override public void unpack(ByteBuffer b) throws IOException {
super.unpack(b);
// id
this.id = b.read_short();
// type
this.type = b.read_short();
}}
public static class FightUnitVO extends BaseVO {
public short id;
public short seat;
public String name;
public String avatar;
public short hp;
public short maxhp;
public short act_skill;
public SkillVO[] skills;
@Override public int vid() { return 8; }
@Override public void pack(ByteBuffer b) throws IOException {
super.pack(b);
// id
b.write_short(this.id);
// seat
b.write_short(this.seat);
// name
b.write_string(this.name);
// avatar
b.write_string(this.avatar);
// hp
b.write_short(this.hp);
// maxhp
b.write_short(this.maxhp);
// act_skill
b.write_short(this.act_skill);
// skills
b.write_short(skills.length);
for (SkillVO node_skills : this.skills){
node_skills.pack(b);
}
}
@Override public void unpack(ByteBuffer b) throws IOException {
super.unpack(b);
// id
this.id = b.read_short();
// seat
this.seat = b.read_short();
// name
this.name = b.read_string();
// avatar
this.avatar = b.read_string();
// hp
this.hp = b.read_short();
// maxhp
this.maxhp = b.read_short();
// act_skill
this.act_skill = b.read_short();
// skills
int n_skills = b.read_short();
this.skills = new SkillVO[n_skills];
for(int i_skills=0;i_skills<n_skills;i_skills++){
SkillVO p_skills =new SkillVO();
p_skills.unpack(b);
this.skills[i_skills]=p_skills;
}
}}
public static class FightUnitsVO extends BaseVO {
public FightUnitVO[] items;
@Override public int vid() { return 9; }
@Override public void pack(ByteBuffer b) throws IOException {
super.pack(b);
// items
b.write_short(items.length);
for (FightUnitVO node_items : this.items){
node_items.pack(b);
}
}
@Override public void unpack(ByteBuffer b) throws IOException {
super.unpack(b);
// items
int n_items = b.read_short();
this.items = new FightUnitVO[n_items];
for(int i_items=0;i_items<n_items;i_items++){
FightUnitVO p_items =new FightUnitVO();
p_items.unpack(b);
this.items[i_items]=p_items;
}
}}
public static class BattleVO extends BaseVO {
public String title;
public FightUnitVO[] all;
@Override public int vid() { return 10; }
@Override public void pack(ByteBuffer b) throws IOException {
super.pack(b);
// title
b.write_string(this.title);
// all
b.write_short(all.length);
for (FightUnitVO node_all : this.all){
node_all.pack(b);
}
}
@Override public void unpack(ByteBuffer b) throws IOException {
super.unpack(b);
// title
this.title = b.read_string();
// all
int n_all = b.read_short();
this.all = new FightUnitVO[n_all];
for(int i_all=0;i_all<n_all;i_all++){
FightUnitVO p_all =new FightUnitVO();
p_all.unpack(b);
this.all[i_all]=p_all;
}
}}
public static class SceneUnitVO extends BaseVO {
public short id;
public String name;
public String avatar;
public short state;
@Override public int vid() { return 11; }
@Override public void pack(ByteBuffer b) throws IOException {
super.pack(b);
// id
b.write_short(this.id);
// name
b.write_string(this.name);
// avatar
b.write_string(this.avatar);
// state
b.write_short(this.state);
}
@Override public void unpack(ByteBuffer b) throws IOException {
super.unpack(b);
// id
this.id = b.read_short();
// name
this.name = b.read_string();
// avatar
this.avatar = b.read_string();
// state
this.state = b.read_short();
}}
public static class SceneUnitsVO extends BaseVO {
public SceneUnitVO[] items;
@Override public int vid() { return 12; }
@Override public void pack(ByteBuffer b) throws IOException {
super.pack(b);
// items
b.write_short(items.length);
for (SceneUnitVO node_items : this.items){
node_items.pack(b);
}
}
@Override public void unpack(ByteBuffer b) throws IOException {
super.unpack(b);
// items
int n_items = b.read_short();
this.items = new SceneUnitVO[n_items];
for(int i_items=0;i_items<n_items;i_items++){
SceneUnitVO p_items =new SceneUnitVO();
p_items.unpack(b);
this.items[i_items]=p_items;
}
}}
public static class SceneVO extends BaseVO {
public String title;
public SceneUnitVO[] friend_npc;
public SceneUnitVO[] enermy_npc;
@Override public int vid() { return 13; }
@Override public void pack(ByteBuffer b) throws IOException {
super.pack(b);
// title
b.write_string(this.title);
// friend_npc
b.write_short(friend_npc.length);
for (SceneUnitVO node_friend_npc : this.friend_npc){
node_friend_npc.pack(b);
}
// enermy_npc
b.write_short(enermy_npc.length);
for (SceneUnitVO node_enermy_npc : this.enermy_npc){
node_enermy_npc.pack(b);
}
}
@Override public void unpack(ByteBuffer b) throws IOException {
super.unpack(b);
// title
this.title = b.read_string();
// friend_npc
int n_friend_npc = b.read_short();
this.friend_npc = new SceneUnitVO[n_friend_npc];
for(int i_friend_npc=0;i_friend_npc<n_friend_npc;i_friend_npc++){
SceneUnitVO p_friend_npc =new SceneUnitVO();
p_friend_npc.unpack(b);
this.friend_npc[i_friend_npc]=p_friend_npc;
}
// enermy_npc
int n_enermy_npc = b.read_short();
this.enermy_npc = new SceneUnitVO[n_enermy_npc];
for(int i_enermy_npc=0;i_enermy_npc<n_enermy_npc;i_enermy_npc++){
SceneUnitVO p_enermy_npc =new SceneUnitVO();
p_enermy_npc.unpack(b);
this.enermy_npc[i_enermy_npc]=p_enermy_npc;
}
}}
public static class MsgVO extends BaseVO {
public String msg;
@Override public int vid() { return 14; }
@Override public void pack(ByteBuffer b) throws IOException {
super.pack(b);
// msg
b.write_string(this.msg);
}
@Override public void unpack(ByteBuffer b) throws IOException {
super.unpack(b);
// msg
this.msg = b.read_string();
}}
public static class AssetsVO extends BaseVO {
public int[] items;
@Override public int vid() { return 15; }
@Override public void pack(ByteBuffer b) throws IOException {
super.pack(b);
// items
b.write_short(items.length);
for (int node_items : this.items){
b.write_int(node_items);
}
}
@Override public void unpack(ByteBuffer b) throws IOException {
super.unpack(b);
// items
int n_items = b.read_short();
this.items = new int[n_items];
for(int i_items=0;i_items<n_items;i_items++){
this.items[i_items] = b.read_int();
}
}}
}
